﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using turnos.core.util;
using turnos.core.modelo;
using Reportman.Reporting;
using Reportman.Drawing.Forms;
using System.Configuration;

namespace turnos.escritorio
{
    public partial class frmListadoTurnosWeb : Form
    {

        public frmListadoTurnosWeb()
        {
            InitializeComponent();
        }

        private void frmListadoTurnosWeb_Load(object sender, EventArgs e)
        {
            dtpFecha.Text = DateTime.Now.ToShortDateString();
        }

        private void btnImprimir_Click(object sender, EventArgs e)
        {

            Report rp = new Reportman.Reporting.Report();
            rp.LoadFromFile("agendadiaria.rep");
            string cnx = @ConfigurationManager.ConnectionStrings["Reportes"].ConnectionString;
            rp.DatabaseInfo[0].ProviderFactory = "System.Data.SqlClient";
            rp.DatabaseInfo[0].ConnectionString = cnx;
            rp.Params[0].Value = dtpFecha.Text;
            PrintOutWinForms prw = new PrintOutWinForms();
            prw.Preview = true;
            prw.Print(rp.MetaFile);
        }

    }
}
